import instance from '@/utils/request'
import {products,goodsid,Get_GoodsByTypeList,GetTagGoodsList} from '@/types/reqtypes'
//获取商品列表
export function Products(params: products){
    return instance.post("/GetGoodsList",
        params
    ).then(data => [true, data])
    .catch(err => [false,err])
}
//获取商品详情
export function Details(params: goodsid){
    return instance.post("/getGoodsInfoList",
        params
    ).then(data => [true, data])
    .catch(err => [false,err])
}
//获取促销商品
export function GoodsType(params: Get_GoodsByTypeList){
    return instance.post("/Get_GoodsByTypeList",
        params
    ).then(data => [true, data])
    .catch(err => [false,err])
}
//获取商品分类
export function GetProductClass(){
    return instance.post("/GetProductClass").then(data => [true, data])
    .catch(err => [false,err])
}
//获取标签商品列表
export function GetTagGoodsList(params: GetTagGoodsList){
    return instance.post("/GetTagGoodsList",
        params
    ).then(data => [true, data])
    .catch(err => [false,err])
}